package zoogames;

public abstract class AbstractAnimal {

    protected String name = "";
    protected int yellNum = 1;
    protected String yellName = "";

    AbstractAnimal(){
        this.name = "无名";
    }

    AbstractAnimal(String AnimalName){
        this.name = AnimalName;
    }

    public void shout() {
        System.out.print("我是" + this.name + ":");
        for(int i = 0; i < this.yellNum; ++i){
            System.out.print(getShoutName());
        }
        System.out.println();
    }

    protected  abstract String getShoutName();//运行是类型，会运行继承链汇总最末端的方法

}